#!/bin/bash

version=$V_PORTAL

echo "k8s工程版本号：${version}"

# 删除旧配置文件
rm -rf ./target/*

mkdir -p ./target/dev/config
mkdir -p ./target/gray/config
mkdir -p ./target/prod/config

# 创建新配置文件目录，复制脚本
cat ENVS | while read env
do
  mkdir -p ./target/${env}/config
  chmod +x ./bin/${env}/*.sh
  cp ./bin/${env}/* ./target/${env}/
done

# 根据模板生成k8s启动文件
cat ENVS | while read env
do
  ./variable_injection.sh client-portal $env
done

scp -r ./target/* root@10.100.232.206:/root/workspace/client-portal/
